using System;
using System.Collections.Generic;
using System.Text;
using DTO;
using DAL;

namespace BUS
{
    public class ComentalbumBUS
    {
        public static void Insert(tbCommentalbum Commentalbum)
        {
            CommentAlbumDAL commenalbumdal = new CommentAlbumDAL();
            commenalbumdal.Insert(Commentalbum);
        }
        public static void Update(tbCommentalbum Commentalbum)
        {
            CommentAlbumDAL commenalbumdal = new CommentAlbumDAL();
            commenalbumdal.Update(Commentalbum);
        }
        public static void Delete(int iD)
        {
            CommentAlbumDAL commenalbumdal = new CommentAlbumDAL();
            commenalbumdal.Delete(iD);
        }
        public static tbcommentalbumcollection GET(string Where, int PageIndex, int PageSize,
                                        string OrderBy, string OrderDirection,
                                        out int TotalRecords)
        {
            CommentAlbumDAL commenalbumdal = new CommentAlbumDAL();
            return commenalbumdal.GET(Where, PageIndex, PageSize,
                            OrderBy, OrderDirection, out TotalRecords);
        }
        public static tbCommentalbum GetByID(int iD)
        {
            int t = 0;
            CommentAlbumDAL commenalbumdal = new CommentAlbumDAL();
            tbcommentalbumcollection commentalbumcollection = commenalbumdal.GET("where " + tbcommentalbumcolumn.idalbum.ToString() + " = " + iD.ToString(), 0, 0,
                tbcommentalbumcolumn.idcommentalbum.ToString(), "ASC", out t);
            if (commentalbumcollection.Count == 1)
                return commentalbumcollection[0];
            return null;
        }
        public static tbcommentalbumcollection GetAll()
        {
            int t = 0;
            CommentAlbumDAL commenalbumdal = new CommentAlbumDAL();
            return commenalbumdal.GET("where 1=1", 0, 10,
                tbcommentalbumcolumn.idalbum.ToString(), "ASC", out t);
        }
    }
}
